package datastream.api.operator.multi.source.user;

import datastream.api.operator.multi.pojo.user.InputModel;
import org.apache.flink.streaming.api.functions.source.SourceFunction;


public class UserSource2 implements SourceFunction<InputModel> {

    @Override
    public void run(SourceContext<InputModel> ctx) throws Exception {
        ctx.collect(InputModel.builder()
                .username("张三2")
                .age(14)
                .build());
        Thread.sleep(1000);

        ctx.collect(InputModel.builder()
                .username("李四2")
                .age(37)
                .build());
    }

    @Override
    public void cancel() {

    }
}